{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from rdkit import Chem\n",
    "from rdkit.Chem import AllChem\n",
    "from rdkit.Chem.Draw import IPythonConsole\n",
    "from rdkit.Chem.Draw import MolDrawing, DrawingOptions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# for visualization of molecules including atom numbers\n",
    "def mol_with_atom_index( mol ):\n",
    "    atoms = mol.GetNumAtoms()\n",
    "    for idx in range( atoms ):\n",
    "        mol.GetAtomWithIdx( idx ).SetProp( 'molAtomMapNumber', str( mol.GetAtomWithIdx( idx ).GetIdx() ) )\n",
    "    return mol"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "def add_bond_between_substructures(mol_1, mol_2, begin_atom_idx,\n",
    "                                   end_atom_idx, bond_type):\n",
    "    \"\"\"\n",
    "    Given two rdkit mol objects, begin and end atom indices of the new bond, the bond type, returns a new mol object\n",
    "    that has the corresponding bond added. Note that the atom indices are based on the combined mol object, see below\n",
    "    MUST PERFORM VALENCY CHECK AFTERWARDS\n",
    "    :param mol_1:\n",
    "    :param mol_2:\n",
    "    :param begin_atom_idx:\n",
    "    :param end_atom_idx:\n",
    "    :param bond_type:\n",
    "    :return: rdkit mol object\n",
    "    \"\"\"\n",
    "    combined = Chem.CombineMols(mol_1, mol_2)\n",
    "    rw_combined = Chem.RWMol(combined)\n",
    "    \n",
    "    # check that we have an atom index from each substructure\n",
    "    grouped_atom_indices_combined = Chem.GetMolFrags(rw_combined)\n",
    "    substructure_1_indices, substructure_2_indices = grouped_atom_indices_combined\n",
    "    if begin_atom_idx in substructure_1_indices:\n",
    "        if not end_atom_idx in substructure_2_indices:\n",
    "            raise ValueError('Invalid atom indices')\n",
    "    elif end_atom_idx in substructure_1_indices:\n",
    "        if not begin_atom_idx in substructure_2_indices:\n",
    "            raise ValueError('Invalid atom indices')\n",
    "    else:\n",
    "        raise ValueError('Invalid atom indices')\n",
    "        \n",
    "    rw_combined.AddBond(begin_atom_idx, end_atom_idx, bond_type)\n",
    "\n",
    "    return rw_combined.GetMol()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "mol_1 = Chem.MolFromSmiles('CCCc1ccccc1')\n",
    "mol_2 = Chem.MolFromSmiles('OC=O')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nO3deVgT19oA8BPCFiGAVUFcoKaiBNyjWEhIiAYQBBWuUK0r6lWrlo9HrCh9FJfbitXigmK9\nRVFxQVBUZFEWwSwuFAUXiC0Vi0VEQEQhJJKEfH9Mb5qCSoJMJpmc319m5kzyRuT1zDln3kNQKBQA\ngiAI6ikjrAOAIAjSbzCNQhD+nT171svLy8bGxszMjEqlRkdHv3r1qmuzY8eOEf7pwIED2o9W7xhj\nHQAEQehavXp1QkLCrFmz9uzZQyaTKyoqjhw5Ul1dferUqa6NTUxMTp8+rXw5fvx4LUaqr2AahSA8\nS0tLS0hI2L17d2RkpPLg+vXrc3Jy3tneyMho9uzZ2ooOJwhwigmCcMzDw6O5ubm8vJxAIHTb+Nix\nYytXrhSLxRKJhEQiaSE8fIBjoxCEW2KxuLi42N/f/305lM/nEwiEzMxM5ZH29nYrK6s+ffoMGTJk\n9+7dsJulDnhTD0G49eLFC7lcPnTo0Pc1IBAIRCLRyOiv7pStrW10dPSkSZPa29vT0tK++eablpaW\nrVu3aitefQVv6iEIn8Ri8YsXL4YNG7Zv377w8PAevMOcOXMyMjJevnwJb/A/DN7UQxB+VFVVnThx\nYsWKFa6urnPmzLGzszM2Nn769GnP3i0kJEQsFguFwt4NEn/gTT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ZMgQAMCbN2+Ki4uRXmdxcbFUKkXaq9a09/LyGjBggFa/mGGDaRSCtET9\nAp1Xrlzx8/P78ssv586dW1dXFxMT079//zt37vz000/h4eHK31lTU9OJEyci1UUZDIaVlZXWvxME\nAHwYFIK0Iy0tLSEhYffu3ZGRkcqD69evz8nJ6do4JSXl008/TU5ORqaAyGTynDlzhEKhq6sriUQa\nP348g8FANqGDqVMXwDQKQdqwZ88eKpW6du1a1YPm5uZBQUFdG0ulUjKZrJxGR+76FQqFp6dnc3Mz\nejVMoZ6Byx0gCHVisbi4uNjf3/99s+R8Pp9AIGRmZiIvw8LCKioq4uPjX758WVFRERMTw2Qyx4wZ\nY2xsDHOoDoJpFIJQp2mBTg6Hc/r06fXr1/fv39/V1ZVIJF66dElbwUIag2kUgrSk2wKdyifQeTze\n0qVLFy9enJube/Lkybq6upkzZ76zgiekC+DYKAShzs7OTqMCnZGRke7u7ocOHUJeUqlUGo2Wnp4e\nGhqKWoxQz8HeKAShjkQiubm5ZWdnq7m+8NGjR+PGjVO+HDNmDIFAePz4MWoBQh8FplEI0oaIiAih\nUBgXF6d6UCKRpKend23s6OhYUlKifFlSUqJQKODDSDqLuGXLFqxjgCD8c3V1bWho+O6770pLS0Ui\nUWVl5blz55YuXSoWi4ODgwUCAYVCmThxopOTEwBAoVAkJCQ8efKEQCBcv349PDzcxsZm7969ZmZm\nWH8P6B3g2CgEacnBgwc9PT0PHToUGRkpkUgoFMqiRYuQ1fgKhUIul3d0dCAtV61aZWxsnJCQcP78\neSsrKzqdHhsbSyaTMQ0feq//B38nBok8X2fcAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f46a55a6030>"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# mol 1\n",
    "mol_with_atom_index(mol_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "i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wZQEJCQlZWVlBQEO9Q\nhFgPrdQTcyUmJur1erVa7eXllZ+fr9PpeCcixKpoa5RYTE1NzbZt2z788EM6SEpEhWqUEELMQjv1\nhBBiFqpRQggxC9UoIYSYhWqUEELMQjVKCCFmoRolhBCzUI0SQohZqEYJIcQs/websbwf/sMtaQAA\nAABJRU5ErkJggg==\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f46a55a6080>"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# mol 2\n",
    "mol_with_atom_index(mol_2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nO3daVwT59YA8BMCJCFAoVhQ3oKKoOwqBZXFgCKbgnWl1FqpW7WuVGy1KgV763LVK6IWr3Jx\nt6xSCyoiYBWCC+JFRcCKxYV7VRAkiBCEhHk/xBsRAmYhmSSc/68fmJknM2eonMw88zxzKARBAEII\nIWlpkB0AQgipNkyjSDYEAf/6F7i4AJMJH3wA3t6QldVT+7IyWLAA7O1BQwO8vCTbSpb3nuPataCr\n2/lTM2bAiBHd7jMpCezsgEaDIUNg9+7ejxkpEKZRJJt58+Drr8HBAY4cgdhY0NICf3/Yu7fb9sXF\nkJMD9vYweLDEW8ki6Tm+1/nzEBICI0dCSgrMnAlhYTLtDZGOQEhqCQkEALFr1zsrZ88mtLSI0lLR\nH+Hz3/zg50d4ekq2lRTinOOaNQST2fmD06cTw4eL3ufo0YSLy9vFhQuJfv2ItrbeChkpGF6NIhnE\nxMDAgbB06TsrN28GAPjlF9Ef0ejxn1zPW0khxTn2jCDg1i3w83u7xs8Pamvh2jUZokRkUr5/tUhV\ncLlw/TpMmgSamu+sNzODTz6BvLw3i2w2UChw+rTiA+wFYp6jAIfzzn9tbW83d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H29jYdHpcQ6fTp06d2rVx\nW1ubnp6ecBSnoaEhABAEYWho2NDQ0OleHqklHPCE0DskLdg3d+7csrKyPXv21NXVlZWVRUZGslgs\nR0dHAMAc2kdgGkXoHZJOIpowYcKvv/76/fff9+vXz87Ojkql/v7774oKFikFTKMIiSD+JKL8/Pz5\n8+d/9dVX58+fP378+LNnzz799FMej6egQJESwL5RhN4h6SSi8PBwV1fXffv2CRZtbGw++eSTtLS0\n4OBgucWIlAtejSL0DkkL9t29e3fEiBHCRUdHRwqF8tdff8ktQKR0MI0i1FlYWFh5efnOnTs7rmxp\naUlLS+vaeODAgUVFRcLFoqIigiAEJUlQH0GNiooiOwaElIudnd3z5883bdpUXFzc1NRUUVGRmpo6\nf/58Lpc7bdq0goICCwsLZ2dnKysrACAIIjY29sGDBxQK5dKlSytWrDAwMNi1axeNRiP7PJCCYN8o\nQiL88ssvY8eO3bdvX3h4eEtLi4WFRWhoqGCGO0EQfD6/vb1d0HLJkiWampqxsbEnT57U19d3d3ff\nunVrr7/NBCmz/wdJTmNb8K714QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f46a55a6490>"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# note that only mol_1 keeps its original atom numbers in the combined mol object. \n",
    "# mol_2 has its atom numbers reindexed by: old atom number + mol_1.GetNumAtoms()\n",
    "combined = Chem.CombineMols(mol_1, mol_2)\n",
    "mol_with_atom_index(combined)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nO3dd1xT994H8G9ARmSToAgoGAciWrdYw2qZsqSODlttedoraMXb1gFcntaNtJe2XkWEK7dW\ntFXK9XGgICUxlhAZIlRlllEB2SCjAgok5/njUISAN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yIk17A3qqAKCuDBA9i0aUDju++CkhKQS+Lfvg2nTg3xQoEAFi2SRUKEFAWWUQXV\n0AAAYGIyoFFZGQwNob4eACAwEEpKxF8VEQE3bkBYmEwiIqQgsIwqKAMDAICqqgGNQiHU1vYeGuxf\n/4JDh4DHAzOz0U6HkCLBMqqgLCzA1FT80fy5cyAU9i77JGb/fvj6a7h5EwLXUroAAACESURBVCwt\nZRMQIYUxgeoAaHTQaHDsGKxbB0wmfPghaGjAtWvg7w/Bwb2dTR4PMjIgMBAAYOdOiIuD5GSYOhWe\nPAEaDdTUKE2PkDzBJ/UKLSUFDhyA9HTo7oa5c2H7dvjgg95DoaEQHQ0lJfD4MWhpDXiVmho8eSLz\nrAjJKyyjCCE0Iv8PXXJsKc2kA0UAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f46a55a6620>"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# example of successful bond addition\n",
    "begin_atom_idx = 5\n",
    "end_atom_idx = 10\n",
    "bond_type = Chem.rdchem.BondType.SINGLE\n",
    "m = add_bond_between_substructures(mol_1, mol_2, begin_atom_idx, end_atom_idx, bond_type)\n",
    "Chem.SanitizeMol(m,sanitizeOps=Chem.SanitizeFlags.SANITIZE_PROPERTIES)  # check valency\n",
    "m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcIAAACWCAIAAADCEh9HAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nO3de1gTV9oA8DcEieEaRImigGJRUkTlIi7gIsXbgqylVuzWirrSsk9rS6nbFlfrRtvaWmUR\nSz9bamtLtYLgQx8BQdd6K1hdRLGKCYo3UCw3BcUQbsn5/hgaEVATZjKThPf3+AczTk7evAzvzJw5\nc8IjhABCCKH+MuM6AIQQMm4mVEZXrQJr654rFyyAyZ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+c+AgIAvv/ySWpRIJL6+vtnZ2QsXLtRbjMikL+qFQqG/\nv39+fr6WJ5UeHh5yuVyzWF5eTgjx8PDQW4BGT9cMA0BdXd3s2bOdnJz27l99bAMAAAFrSURBVN2L\np0hPpWuGy8vLJ0+erFmcOHEij8e7evWq3gJEAKZdRgEgPj5eLpcnJSV1X9na2pqdnd1747CwsCNH\njtTV1VGLGRkZQqFw+vTpbARqtHTKcHNzM/WFdPn5+VZWViyFaOR0yrCrq2tJSYlmsaSkhBAyevRo\nfQc5wPHXrVvHdQx65OnpWV9fv2HDhtLSUoVCUVFRsXfv3piYGKVSOX/+/BMnTri5ufn5+bm7u1Mb\nf/vttwcOHHBwcMjLy9uwYcO7776r+R5K1CedMvziiy8WFRUlJCTcu3dP9ofx48f3eQ8KUXTKMCFk\n27Zt169f5/F4x48fj4uLE4lEycnJ1PeSIn3hcLAVa9LT04ODg21tbS0sLDw8PNauXUt9IXthYSEA\n5Obmara8cOFCSEjI4MGDhw8fvnbtWpxMTEtaZpj6xvYempubOY3dOGiZYbVa/dVXX02cONHKymrE\niBELFiy4cuUKp4EPCP8PIdKZZFkjz0UAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f46a55a6670>"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# importance of performing valency checks afterwards. This molecule is invalid due to 6 bonds at C1\n",
    "begin_atom_idx = 1\n",
    "end_atom_idx = 10\n",
    "bond_type = Chem.rdchem.BondType.TRIPLE\n",
    "m = add_bond_between_substructures(mol_1, mol_2, begin_atom_idx, end_atom_idx, bond_type)\n",
    "m"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
